Example 1: Atomic
This first example demonstrates how to import or update records with data in the following single value (atomic) fields:
Fields |
Back-end name |
---|---|
First name | NamFirst
|
Middle name | NamMiddle
|
Last name | NamLast
|
Party Type | NamPartyType
|
Notes | NotNotes
|
It also demonstrates how to specify data that contains Carriage Return / New Lines, as in the following Notes field:
Joe has been with the institution for a number of years.
The level of commitment he has shown has been terrific!
He should be considered for promotion at the next staff review.
- The first line in every TSV / CSV file must contain the field names as column headings:
NamPartyType
NamFirst
NamMiddle
NamLast
NotNotes
- Each subsequent row contains a single record. The values are simply entered in the appropriate column:
NamPartyType
NamFirst
NamMiddle
NamLast
NotNotes
Person Joe J Jackson Person Michael Williamson Person Wilbur Withers A useful saxophone player. - To add a note with carriage returns in MS Excel:
- Enter the first line: Joe has been with the institution for a number of years.
- Press ALT+ENTER.
- Enter the next line, and so on.
NamPartyType
NamFirst
NamMiddle
NamLast
NotNotes
Person
Joe
J
Jackson
Joe has been with the institution for a number of years.
The level of commitment he has shown has been terrific!
Should be considered for promotion at the next staff review.
Person
Michael
Williamson
Person
Wilbur
Withers
A useful saxophone player.
The XML for this example is:
<?xml version="1.0" encoding="UTF-8"?>
<table>
<!-- First record-->
<tuple>
<atom name="NamPartyType">Person</atom>
<atom name="NamFirst">Joe</atom>
<atom name="NamMiddle">J</atom>
<atom name="NamLast">Jackson</atom>
<atom name="NotNotes">Joe has been with the institution for a number of years.
The level of commitment he has shown has been terrific!
He should be considered for promotion at the next staff review.</atom>
</tuple>
<!--Second record-->
<tuple>
<atom name="NamPartyType">Person</atom>
<atom name="NamFirst">Michael</atom>
<atom name="NamLast">Williamson</atom>
</tuple>
<!--Third record-->
<tuple>
<atom name="NamPartyType">Person</atom>
<atom name="NamFirst">Wilbur</atom>
<atom name="NamLast">Withers</atom>
<atom name="NotNotes">A useful saxophone player.</atom>
</tuple>
</table>
Note:
- Except for the XML declaration (called a processing instruction) at the very top of the code (<?xml version="1.0" encoding="UTF-8"?>), XML tags occur as pairs where each pair must have an opening and closing tag, e.g. <table> and </table>.
Commented code:
<!--This is the XML declaration and should appear at the beginning of any XML document; it identifies the document as XML and specifies the release of XML that it conforms to. The encoding defines the character set of the raw data; UTF-8 specifies the Unicode character set used by EMu-->
<?xml version="1.0" encoding="UTF-8"?>
<--! The opening and closing table tags must surround the data to be imported-->
<table>
<!--First record-->
<!--Each tuple represents a single record. A tuple can include atoms, tuples and tables-->
<tuple>
<!--Each atom represents a single value. The format for an atom is: <atom name="colname">value</atom> -->
<atom name="NamPartyType">Person</atom>
<atom name="NamFirst">Joe</atom>
<atom name="NamMiddle">J</atom>
<atom name="NamLast">Jackson</atom>
<!--Text and paragraph formatting entered between the atom tags is retained when the XML is imported into EMu. In this example, three lines of text are specified in the XML, and three lines will be imported into the Notes field-->
<atom name="NotNotes">Joe has been with the institution for a number of years.
The level of commitment he has shown has been terrific!
He should be considered for promotion at the next staff review.</atom>
</tuple>
<!--Second record-->
<tuple>
<!--When specifying atoms, only fields that contain values are specified. In the previous record (tuple) five values were specified; this one only has three-->
<atom name="NamPartyType">Person</atom>
<atom name="NamFirst">Michael</atom>
<atom name="NamLast">Williamson</atom>
</tuple>
<!--Third record-->
<tuple>
<atom name="NamPartyType">Person</atom>
<atom name="NamFirst">Wilbur</atom>
<atom name="NamLast">Withers</atom>
<atom name="NotNotes">A useful saxophone player.</atom>
</tuple>
<!--Don't forget to close off all of the tags-->
</table>